<?php
class discussion_Controller extends GlobalAction {
	public $__default = 'HTML';
	
	public function proceedHTML () {
		$replys = xine::$model->getReplys((int)$this->params[0]);
		
		$replysStr = '';
		
		foreach($replys as $reply) {
			$replysStr .= xine::$view->getReply($reply);
		}
		
		$discussionInfo = xine::$model->getDiscussion((int)$this->params[0]);
		$discussionInfo['replys'] =& $replysStr;
		
		$discussion = xine::$view->tpl->compile('discussion', $discussionInfo);
		
		xine::$view->tpl->assign(array('content'=>$discussion, 'panel'=>xine::$view->sideBar(), 'menuItems'=>xine::$view->getMenu()));
		xine::$view->tpl->show();
	}
}